package xju.ssm_17_18.config;


import org.springframework.context.annotation.*;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

@Configuration
@ComponentScan({"xju.ssm_17_18.service","xju.ssm_17_18.mapper"})
@EnableTransactionManagement
@EnableAspectJAutoProxy
@Import({DataSourceConfig.class, MybatisConfig.class})
public class SpringConfig {

    // 事务管理器
    @Bean
    public TransactionManager transactionManager(DataSource dataSource) {
        return new DataSourceTransactionManager(dataSource);
    }
}
